/* 
 * File:   IFile.h
 * Author: alexey
 *
 * Created on 20 Март 2011 г., 1:09
 */

#ifndef IFILE_H
#define	IFILE_H
#include <sys/types.h>
#include "IServiceLocator.h"
#include <string.h>

namespace storagemon
{
    class IFile : public IService
    {
    public:
        virtual ~IFile() {};
        virtual bool operator==(const IFile &other) const
        {
            bool res = true;
            if (strcmp(other.full_path(), this->full_path()) != 0)
                res = false;
            if (other.id() != this->id())
                res = false;
            if (other.parent_id() != this->parent_id())
                res = false;
            return res;
        };
    public:
        virtual u_long id() const = 0;
        virtual const char* name() const = 0;
        virtual const char* path() const = 0;
        virtual const char* full_path() const = 0;
        virtual u_long parent_id() const = 0;
        virtual char* md5() = 0;
        virtual char* md5_string(char* md5) = 0;
    };

    const char FILEOBJECT[] = "fileobject";
}


#endif	/* IFILE_H */
